from typing import Annotated
from urllib.parse import quote_plus

from fastapi import Depends
from sqlalchemy import create_engine
from sqlmodel import Session

url = "152.136.144.72:3306"
username = "root"
password = "NzI@hFFO4FtJkpCv"
engine = create_engine(f"mysql+pymysql://{username}:{quote_plus(password)}@{url}/account_book?use_unicode=true&charset=utf8mb4", echo=True)

def get_session():
    with Session(engine) as session:
        yield session

SessionDep = Annotated[Session, Depends(get_session)]
